// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vuex from 'vuex'
import FastClick from 'fastclick'
import VueRouter from 'vue-router'
import App from './App'
import router from './router/index'
import { store } from './store/store'
// import axios from 'axios'
import axios from './axios/http'

// import cordova from '../static/cordova/cordova'
import { WechatPlugin, AjaxPlugin, LoadingPlugin, ToastPlugin, AlertPlugin, TransferDom, ConfirmPlugin } from 'vux'
Vue.use(VueRouter)
/**
 * 加载插件
 */

Vue.use(Vuex)
Vue.use(WechatPlugin)
Vue.use(AjaxPlugin)
Vue.use(LoadingPlugin)
Vue.use(ToastPlugin, { position: 'middle', time: '2000' })
Vue.use(ConfirmPlugin)
Vue.use(AlertPlugin)
Vue.prototype.$http = axios
// Vue.prototype.cordova = cordova
//
/**
 *
 */
Vue.directive('transfer-dom', TransferDom)
/**
 * 设置vuex
 */
/**
 * 公用组件
 */
Vue.prototype.updateTitle = function (value) {
  this.$store.commit('updateTitle', value)
}
FastClick.attach(document.body)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  store,
  router,
  axios,
  render: h => h(App)
}).$mount('#app-box')
